package wx.enums;

public enum YesNo {
	YES("是",1),NO("否",0),DEF("",null);
	private String name;
	private Integer code;

	private YesNo(String name, Integer code) {
		this.name = name;
		this.code = code;
	}


    public static String getName(Integer code) {
		if(code == null){
			return  "";
		}
        for (YesNo c : YesNo.values()) {
            if (code.equals(c.getCode())){
                return c.name;
            }
        }
        return null;
    }

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}


}